//package com.ruoyi.web.controller.system;
//
//import java.util.List;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.domain.AjaxResult;
//import com.ruoyi.common.core.page.TableDataInfo;
//import com.ruoyi.system.domain.Meter;
//import com.ruoyi.system.domain.MeterRecord;
//import com.ruoyi.system.domain.vo.MeterRecordVO;
//import com.ruoyi.system.service.IMeterRecordService;
//import com.ruoyi.system.service.IMeterService;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//
///**
// * 电记录Controller
// *
// * @author ruoyi
// * @date 2021-10-29
// */
//@Api("电表记录")
//@RestController
//@RequestMapping("/system/record")
//public class MeterRecordController extends BaseController
//{
//    @Autowired
//    private IMeterRecordService meterRecordService;
//    @Autowired
//    private IMeterService meterService;
//
//    /**
//     * 查询电记录列表
//     */
//    @ApiOperation(" 查询充值电列表  meterId查询 ")
//    @GetMapping("/list")
//    public TableDataInfo list(MeterRecordVO meterRecord)
//    {
//        startPage();
//        meterRecord.setType(1);
//        List<MeterRecord> list = meterRecordService.selectMeterRecordList(meterRecord);
//        return getDataTable(list);
//    }
//
//
//    @ApiOperation(" 查询单个电表费用和  meterId查询 startTime  开始时间  endTime 结束时间 ")
//    @GetMapping("/selectMeterRecordSum")
//    public AjaxResult selectMeterRecordSum(MeterRecordVO meterRecord)
//    {
//    	MeterRecord list = meterRecordService.selectMeterRecordSum(meterRecord);
//    	return AjaxResult.success(list);
//    }
//
//    @ApiOperation(" 定时任务 ")
//    @GetMapping(value = "/meterRecordTask")
//    public AjaxResult meterRecordTask()
//    {
//    	meterRecordService.dealData();
//    	return AjaxResult.success();
//    }
//
//
//    @ApiOperation(" 定时任务 ")
//    @GetMapping(value = "/meterRecordTask2")
//    public AjaxResult meterRecordTask2()
//    {
//    	meterRecordService.dealDate4();
//    	return AjaxResult.success();
//    }
//
//
//    @ApiOperation(" 归零接口 ")
//    @GetMapping("/returnZero")
//    public AjaxResult returnZero(MeterRecordVO meterRecord)
//    {
//    	Long meterId = meterRecord.getMeterId();
//    	if (meterId == null ) {
//			return AjaxResult.error("没传电表id");
//		}
//    	Meter meter = meterService.selectMeterById(meterId);
//    	if (meter == null ) {
//			return AjaxResult.error("电表id错误");
//		}
//    	Integer overall = meter.getOverall();
//    	if (overall != null && overall.equals(2)) {
//    		return AjaxResult.error("总表不能归0");
//		}
//
//
//
//    	return  meterRecordService.returnZero(meterId);
//    }
//
//
//    @ApiOperation(" 查询扣费电列表  meterId查询 ")
//    @GetMapping("/listSubMeter")
//    public TableDataInfo listSubMeter(MeterRecordVO meterRecord)
//    {
//        startPage();
//        meterRecord.setType(2);
//        List<MeterRecordVO> list = meterRecordService.selectMeterRecordListNew(meterRecord);
//        return getDataTable(list);
//    }
//
//
////
////    /**
////     * 导出电记录列表
////     */
////    @PreAuthorize("@ss.hasPermi('system:record:export')")
////    @Log(title = "电记录", businessType = BusinessType.EXPORT)
////    @GetMapping("/export")
////    public AjaxResult export(MeterRecord meterRecord)
////    {
////        List<MeterRecord> list = meterRecordService.selectMeterRecordList(meterRecord);
////        ExcelUtil<MeterRecord> util = new ExcelUtil<MeterRecord>(MeterRecord.class);
////        return util.exportExcel(list, "电记录数据");
////    }
////
////    /**
////     * 获取电记录详细信息
////     */
////    @PreAuthorize("@ss.hasPermi('system:record:query')")
////    @GetMapping(value = "/{id}")
////    public AjaxResult getInfo(@PathVariable("id") Long id)
////    {
////        return AjaxResult.success(meterRecordService.selectMeterRecordById(id));
////    }
////
////    /**
////     * 新增电记录
////     */
////    @PreAuthorize("@ss.hasPermi('system:record:add')")
////    @Log(title = "电记录", businessType = BusinessType.INSERT)
////    @PostMapping
////    public AjaxResult add(@RequestBody MeterRecord meterRecord)
////    {
////        return toAjax(meterRecordService.insertMeterRecord(meterRecord));
////    }
////
////    /**
////     * 修改电记录
////     */
////    @PreAuthorize("@ss.hasPermi('system:record:edit')")
////    @Log(title = "电记录", businessType = BusinessType.UPDATE)
////    @PutMapping
////    public AjaxResult edit(@RequestBody MeterRecord meterRecord)
////    {
////        return toAjax(meterRecordService.updateMeterRecord(meterRecord));
////    }
////
////    /**
////     * 删除电记录
////     */
////    @PreAuthorize("@ss.hasPermi('system:record:remove')")
////    @Log(title = "电记录", businessType = BusinessType.DELETE)
////	@DeleteMapping("/{ids}")
////    public AjaxResult remove(@PathVariable Long[] ids)
////    {
////        return toAjax(meterRecordService.deleteMeterRecordByIds(ids));
////    }
//}
